<div class="content-section implementation GridDemo clearfixes">
    <form class="form-horizontal" [formGroup]="newInspectionPlan"  *ngIf="viewState ==='apply'" >
      <p-panel >
        <p-header>
          <div class="ui-helper-clearfix">
            <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
            <button  pButton  [ngStyle]="{'width':'100px'}" label="返回" (click)="goBack()"   ></button>
            <button  pButton  [ngStyle]="{'float':'right','width':'100px'}" label="保存" (click)="formSave()"    ></button>
            <button  pButton  [ngStyle]="{'float':'right','width':'100px'}" label="提交" (click)="formSubmit()" ></button>
          </div>
        </p-header>
        <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">
          <div class="form-group ui-fluid  " >
            <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>领用单号:</label>
            <div class="col-md-5 col-sm-5 ">
              <input  name="inspectionName" formControlName="sid" type="text" pInputText   placeholder="领用单号自动生成" readonly >
            </div>
            <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>紧急程度:</label>
            <div class=" col-md-5 col-sm-5">
              <div class="ui-g-12 ui-fluid-no-padding">
                <p-dropdown [autoWidth]="false"  [options]="urgency" formControlName="type"  name="fenlei" [(ngModel)]="submitRequiestData.urgency"></p-dropdown>
                <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!newInspectionPlan.controls['type'].valid&&(!newInspectionPlan.controls['type'].untouched)" >
                  <i class="fa fa-close"></i>
                  领用类型必填
                </div>
              </div>
            </div>
          </div>
          <div class="form-group ui-fluid  " >
            <label  class="col-sm-1 col-md-1 col-lg-1  control-label"><span></span>领用人:</label>
            <div class="col-md-5 col-sm-5 ">
              <input  name="inspectionName" formControlName="name" type="text" pInputText    readonly value="{{personalData.name}}">
            </div>
            <label  class=" col-md-1 col-sm-1 control-label"><span></span>部门名称:</label>
            <div class=" col-md-5 col-sm-5">
              <div class="ui-g-12 ui-fluid-no-padding">
                <input type="text" pInputText formControlName="department" name="inspectiondepartment" placeholder="部门名称自动生成"
                       readonly class="cursor_not_allowed"  *ngIf="viewState ==='apply'" value="{{submitRequiestData.org}}"/>
              </div>
            </div>
          </div>
          <div class="form-group ui-fluid  " >
            <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>申请时间:</label>
            <div class="col-md-5 col-sm-5 ">
              <input formControlName="return_time" pInputText type="text"  name="people"    class="no-border" [(ngModel)]="submitRequiestData.create_time" readonly/>
            </div>
            <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>部门审批人:</label>
            <div class=" col-md-5 col-sm-5">
              <div class="ui-g-12 ui-fluid-no-padding">
                <p-dropdown [autoWidth]="false"  [options]="approver" formControlName="check"  name="check" [(ngModel)]="submitRequiestData.approver" ></p-dropdown>
              </div>
            </div>
          </div>
          <div class="form-group ui-fluid " >
            <label  class="col-md-1 col-sm-1 col-lg-1   control-label"><span>*</span>领用说明:</label>
              <div class="col-md-11 col-sm-11 col-lg-11 ">
                <textarea pInputTextarea type="text"  formControlName="remarks" name="content" [(ngModel)]="submitRequiestData.remarks"    ></textarea>
                <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!newInspectionPlan.controls['remarks'].valid&&(!newInspectionPlan.controls['remarks'].untouched)" >
                  <i class="fa fa-close"></i>
                  领用说明必填
                </div>
               </div>
          </div>

        </div>
      </p-panel>
      <div class="ui-g">
        <div class="ui-g-10 ui-sm-12" >
          <div class="ui-g-2  ui-sm-5 ui-fluid">
          </div>
          <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
          </div>
        </div>
        <div class="ui-g-2 ui-sm-12" >
          <div class="ui-g-6  ui-sm-6  ui-fluid">
            <button   pButton   label="移除" (click)="deleteStorage()" [disabled]="selectInsepections.length===0 || selectInsepections.length > 1"></button>
          </div>
          <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
            <button pButton type="button"  (click)="showAddStorageMask()" label="物品选择"></button>
          </div>
        </div>
      </div>
    </form>

     <form class="form-horizontal" [formGroup]="newInspectionPlan" *ngIf="viewState ==='update'">
       <p-panel >
         <p-header>
           <div class="ui-helper-clearfix">
             <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
             <button  pButton  [ngStyle]="{'width':'100px'}" label="返回" (click)="goBack()"   ></button>
             <button  pButton  [ngStyle]="{'float':'right','width':'100px'}" label="保存" (click)="formSave()"   ></button>
             <button  pButton  [ngStyle]="{'float':'right','width':'100px'}" label="提交" (click)="formSubmit()" ></button>
           </div>
         </p-header>
         <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">
           <div class="form-group ui-fluid  " >
             <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>领用单号:</label>
             <div class="col-md-5 col-sm-5 ">
               <input  name="inspectionName" formControlName="sid" type="text" pInputText   placeholder="领用单号自动生成" readonly  value="{{borrowData?.sid}}">
             </div>
             <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>紧急程度:</label>
             <div class=" col-md-5 col-sm-5">
               <div class="ui-g-12 ui-fluid-no-padding">
                 <p-dropdown [autoWidth]="false"  [options]="urgency" formControlName="type"  name="fenlei" [(ngModel)]="borrowData.urgency" ></p-dropdown>
                 <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!newInspectionPlan.controls['type'].valid&&(!newInspectionPlan.controls['type'].untouched)" >
                   <i class="fa fa-close"></i>
                   领用类型必填
                 </div>
               </div>
             </div>
           </div>
           <div class="form-group ui-fluid  " >
             <label  class="col-sm-1 col-md-1 col-lg-1  control-label"><span></span>领用人:</label>
             <div class="col-md-5 col-sm-5 ">
               <input  name="inspectionName" formControlName="name" type="text" pInputText    readonly value="{{personalData.name}}" >
             </div>
             <label  class=" col-md-1 col-sm-1 control-label"><span></span>部门名称:</label>
             <div class=" col-md-5 col-sm-5">
               <div class="ui-g-12 ui-fluid-no-padding">
                 <input type="text" pInputText formControlName="department" name="inspectiondepartment" placeholder="部门名称自动生成"
                        readonly class="cursor_not_allowed" value="{{submitRequiestData.org}}"/>
               </div>
             </div>
           </div>
           <div class="form-group ui-fluid  " >
             <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>申请时间:</label>
             <div class="col-md-5 col-sm-5 ">
               <input formControlName="return_time" pInputText type="text"  name="people"    class="no-border" [(ngModel)]="submitRequiestData.create_time" >
             </div>
             <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>部门审批人:</label>
             <div class=" col-md-5 col-sm-5">
               <div class="ui-g-12 ui-fluid-no-padding">
                 <p-dropdown [autoWidth]="false"  [options]="approver" formControlName="check"  name="check" [(ngModel)]="borrowData.approver"  ></p-dropdown>
               </div>
             </div>
           </div>
           <div class="form-group ui-fluid " >
             <label  class="col-md-1 col-sm-1 col-lg-1   control-label"><span>*</span>领用说明:</label>
               <div class="col-md-11 col-sm-11 col-lg-11 ">
                 <textarea pInputTextarea type="text"  formControlName="remarks" name="content" [(ngModel)]="borrowData.remarks"  ></textarea>
                 <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!newInspectionPlan.controls['remarks'].valid&&(!newInspectionPlan.controls['remarks'].untouched)" >
                   <i class="fa fa-close"></i>
                   领用说明必填
                 </div>
                </div>
           </div>
         </div>
       </p-panel>
       <div class="ui-g">
         <div class="ui-g-10 ui-sm-12" >
           <div class="ui-g-2  ui-sm-5 ui-fluid">
           </div>
           <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
           </div>
         </div>
         <div class="ui-g-2 ui-sm-12" >
           <div class="ui-g-6  ui-sm-6  ui-fluid">
             <button   pButton   label="移除" (click)="updatedeleteStorage()" [disabled]="selectInsepections.length===0 || selectInsepections.length >1"></button>
           </div>
           <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
             <button pButton type="button"  (click)="showAddStorageMask()" label="物品选择"></button>
           </div>
         </div>
       </div>
     </form>

      <form class="form-horizontal" [formGroup]="newInspectionPlan" *ngIf="viewState ==='viewDetail'">
        <p-panel >
          <p-header>
            <div class="ui-helper-clearfix">
              <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
              <button  pButton  [ngStyle]="{'width':'100px'}" label="返回" (click)="goBack()"   ></button>
            </div>
          </p-header>
          <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>领用单号:</label>
              <div class="col-md-5 col-sm-5 ">
                <input  name="inspectionName" formControlName="sid" type="text" pInputText   placeholder="领用单号自动生成" readonly  value="{{borrowData?.sid}}">
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>紧急程度:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input  name="fenlei" formControlName="name" type="text" pInputText    readonly value="{{borrowData.urgency}}" >
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1  control-label"><span></span>领用人:</label>
              <div class="col-md-5 col-sm-5 ">
                <input  name="inspectionName" formControlName="name" type="text" pInputText    readonly value="{{personalData.name}}" >
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span></span>部门名称:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input type="text" pInputText formControlName="department" name="inspectiondepartment" placeholder="部门名称自动生成"
                         readonly class="cursor_not_allowed"   value="{{submitRequiestData.org}}" />
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>申请时间:</label>
              <div class="col-md-5 col-sm-5 ">
                <input formControlName="return_time" pInputText type="text"  name="people"    class="no-border" [(ngModel)]="submitRequiestData.create_time" readonly>
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>部门审批人:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input formControlName="check" pInputText type="text"  name="check"    class="no-border" [(ngModel)]="borrowData.approver"  readonly>
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid " >
              <label  class="col-md-1 col-sm-1 col-lg-1   control-label"><span>*</span>领用说明:</label>
                <div class="col-md-11 col-sm-11 col-lg-11 ">
                  <textarea pInputTextarea type="text"  formControlName="remarks" name="content" [(ngModel)]="borrowData.remarks" readonly></textarea>
                 </div>
            </div>
            <div class="form-group ui-fluid " *ngIf="borrowData.status !== '新建' && borrowData.status !== '待审批'" >
              <label  class="col-md-1 col-sm-1 col-lg-1   control-label">审批意见:</label>
                <div class="col-md-11 col-sm-11 col-lg-11 ">
                  <textarea pInputTextarea type="text"  formControlName="approve_remarks" name="content" [(ngModel)]="borrowData.approve_remarks"  readonly></textarea>
                 </div>
            </div>
          </div>
        </p-panel>
      </form>
      <form class="form-horizontal" [formGroup]="newInspectionPlan" *ngIf="viewState ==='outboundRequestion'">
        <p-panel >
          <p-header>
            <div class="ui-helper-clearfix">
              <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
              <button  pButton  [ngStyle]="{'width':'100px'}" label="返回" (click)="goBack()"   ></button>
            </div>
          </p-header>
          <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>领用单号:</label>
              <div class="col-md-5 col-sm-5 ">
                <input  name="inspectionName" formControlName="sid" type="text" pInputText   placeholder="领用单号自动生成" readonly  value="{{borrowData?.sid}}">
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>紧急程度:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input  name="fenlei" formControlName="name" type="text" pInputText    readonly value="{{submitRequiestData.urgency}}" >
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1  control-label"><span></span>领用人:</label>
              <div class="col-md-5 col-sm-5 ">
                <input  name="inspectionName" formControlName="name" type="text" pInputText    readonly value="{{personalData.name}}" >
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span></span>部门名称:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input type="text" pInputText formControlName="department" name="inspectiondepartment" placeholder="部门名称自动生成"
                         readonly class="cursor_not_allowed"   value="{{submitRequiestData.org}}" />
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid  " >
              <label  class="col-sm-1 col-md-1 col-lg-1   control-label"><span></span>申请时间:</label>
              <div class="col-md-5 col-sm-5 ">
                <input formControlName="return_time" pInputText type="text"  name="people"    class="no-border" [(ngModel)]="submitRequiestData.create_time" readonly>
              </div>
              <label  class=" col-md-1 col-sm-1 control-label"><span>*</span>部门审批人:</label>
              <div class=" col-md-5 col-sm-5">
                <div class="ui-g-12 ui-fluid-no-padding">
                  <input formControlName="check" pInputText type="text"  name="check"    class="no-border" [(ngModel)]="borrowData.approver"  readonly>
                </div>
              </div>
            </div>
            <div class="form-group ui-fluid " >
              <label  class="col-md-1 col-sm-1 col-lg-1   control-label"><span>*</span>领用说明:</label>
                <div class="col-md-11 col-sm-11 col-lg-11 ">
                  <textarea pInputTextarea type="text"  formControlName="remarks" name="content" [(ngModel)]="borrowData.remarks" readonly></textarea>
                 </div>
            </div>
            <div class="form-group ui-fluid " *ngIf="borrowData.status !== '新建' && borrowData.status !== '待审批'" >
              <label  class="col-md-1 col-sm-1 col-lg-1   control-label">审批意见:</label>
                <div class="col-md-11 col-sm-11 col-lg-11 ">
                  <textarea pInputTextarea type="text"  formControlName="approve_remarks" name="content" [(ngModel)]="borrowData.approve_remarks"  readonly></textarea>
                 </div>
            </div>
          </div>
        </p-panel>
        <div class="ui-g">
          <div class="ui-g-10 ui-sm-12" >
            <div class="ui-g-2  ui-sm-5 ui-fluid">
            </div>
            <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
            </div>
          </div>
          <div class="ui-g-2 ui-sm-12" >
            <div class="ui-g-6  ui-sm-6  ui-fluid">
              <!--<button   pButton   label="移除" (click)="deleteStorage()" [disabled]="selectInsepections.length===0"></button>-->
            </div>
            <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
              <button pButton type="button"  (click)="sureApproved()" label="出库" [disabled]="selectInsepections.length === 0"></button>
            </div>
          </div>
        </div>
      </form>
  <div class="ui-g">
  <div class="ui-g-12">
    <label><span>*</span>领用列表</label>
    <p-dataTable [value]="inspections"  emptyMessage="没有数据" (onLazyLoad)="loadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                 [totalRecords]="totalRecords"  [(selection)]="selectInsepections" [editable]="true" *ngIf="viewState ==='apply'" class="application_apply">
      <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
      <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}" [editable]="col.editable"></p-column>
    </p-dataTable>
    <p-dataTable [value]="editInspections" emptyMessage="没有数据"  (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                 [totalRecords]="totalRecords"  [(selection)]="selectInsepections" [editable]="true" *ngIf="viewState ==='update'" class="application_update">
      <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
      <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}" [editable]="col.editable"></p-column>
    </p-dataTable>
    <p-dataTable [value]="editInspections" (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                 [totalRecords]="totalRecords"  [(selection)]="selectInsepections"  *ngIf="viewState ==='viewDetail'" >
      <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
      <p-column  *ngFor="let col of colsDetail" field="{{col.field}}" header="{{col.header}}" [editable]="col.editable"></p-column>
      <ng-template pTemplate="emptymessage" >
        当前没有数据
      </ng-template>
    </p-dataTable>
    <p-dataTable [value]="editInspections" (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                 [totalRecords]="totalRecords"  [(selection)]="selectInsepections"  *ngIf="viewState ==='outboundRequestion'" [editable]="true" class="outboundRequestion" >
      <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
      <p-column  *ngFor="let col of updateRequestioncols" field="{{col.field}}" header="{{col.header}}" [editable]="col.editable"></p-column>
      <ng-template pTemplate="emptymessage" >
        当前没有数据
      </ng-template>
    </p-dataTable>
  </div>

  </div>
</div>




<app-borrow-items
  *ngIf="showBorrowItems"
  (closeBorrowItemsMask)="closeBorrowItemsMask($event)"
  (addDev)="addDev($event)"
></app-borrow-items>


